<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'cash';
cfc('core')->checklogin('jy_jdpm/member.index/');
$return=array();
$return['channel'] = $_SESSION['channel'];
set_html('title','账单-'.$this->plugin_setting('basic')['title']);
if($_RQ['op']=='cash'){
	$membersinfo=pdo_get('jy_jdpm_member',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']));
	$return['info']=$membersinfo;
	$return['total']= number_format($membersinfo['wallet_pledge']-$membersinfo['wallet_pledge_freeze'],2,'.','');	
	$params=array('uniacid'=>$_SESSION['uniacid'],);
	$params['mid']=$_SESSION['uid'];
	$pindex = max(1, intval($_RQ['page']));
	$psize = 20;
	$total='';
	$take=pdo_getslice('jy_jdpm_money_log',$params,array($pindex,$psize),$total,$fields,'','create_time desc');
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	$type=$this->feetypes();
	foreach($take as &$v){		
		$v['create_time']=date('Y/m/d H:i:s',$v['create_time']);
		if($v['type']==1 || $v['type']==2){
				$v['channel']==2;
		}
		$s=$v['type'];
		$v['type']=$type[$s];
		$gid=pdo_getcolumn('jy_jdpm_auction',array('pid'=>$v['pid']),'goodsid');
		$v['name']=pdo_getcolumn('jy_jdpm_goods',array('id'=>$gid),'title');
		$v['name']=$v['name']?$v['name']:'';
		if($v['pid']){
			$v['url']=custom_url('jy_jdpm/detail//pid='.$v['pid'],true);
		}
		
	}
	$return['list']=$take;
	exi($return);	
}